package com.example.selfproperties;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.stereotype.Component;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by Administrator on 2017/1/14 0014.
 *
 * Spring Boot使用宽松的规则用于绑定属性到@ConfigurationProperties beans,所以Environment属性名和bean属性名不需要精确匹配。
 * 常见的示例中有虚线分隔的（比如，context-path绑定到contextPath），环境属性大写转为小写字母（比如：PORT绑定port）。
 */
@ConfigurationProperties(prefix = "com.kfit.company")
//@EnableConfigurationProperties({Prop3.class}) //引用类加上该注解
@Component
public class Prop3 {

    //对应：com.kfit.company.firstName = lin
    private String firstName;

    //对应：com.kfit.company.logo-path = d:/data/files/logo.png
    private String logoPath;

    //对应：com.kfit.company.COMPANY_FULLNAME = 北京知远科技公司
    private String companyFullname;

    private List<String> employs = new ArrayList<String>();


    public String getFirstName() {
        return firstName;
    }

    public void setFirstName(String firstName) {
        this.firstName = firstName;
    }

    public String getLogoPath() {
        return logoPath;
    }

    public void setLogoPath(String logoPath) {
        this.logoPath = logoPath;
    }

    public String getCompanyFullname() {
        return companyFullname;
    }

    public void setCompanyFullname(String companyFullname) {
        this.companyFullname = companyFullname;
    }

    public List<String> getEmploys() {
        return employs;
    }

    public void setEmploys(List<String> employs) {
        this.employs = employs;
    }
}
